package t1_2

import (
	"src/db"
	"src/db/db_modle"
	"src/handler/tools"
	"src/modle"
	"sync"
)

// 紧急联系人号码被使用次数
func CheckUrgencyContactRepeat(ch *chan modle.DetailsType, sy *sync.WaitGroup, uid uint, rrb db_modle.RiskRuleBase) {
	logId := tools.GetLogId(uid, rrb.Oid)
	// 最新联系人
	days, e := db.GetNumOfLastUrgencyContacts(uid, logId)
	if e != nil {
		// 指标查询异常未获取到该用户信息
		tools.FillDetails(rrb.Oid, uint(days), tools.ExecuteFailed, 0, e.Error(), ch, sy)
		return
	}
	tools.BigThanLimit(uint(days), ch, sy, rrb, rrb.Score)
}
